package me.zhengjie.modules.lock.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.annotation.AnonymousAccess;
import me.zhengjie.modules.lock.service.LockDeviceBleKeyService;
import me.zhengjie.modules.lock.service.vo.LockBleKeyInfoListReqVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = {"运营端门锁蓝牙钥匙的接口"})
@RequestMapping("/api/v1/lock/bleKey")
@RestController
public class LockBleKeyController {

    @Autowired
    private LockDeviceBleKeyService lockDeviceBleKeyService;

    @AnonymousAccess
    //@PreAuthorize("@el.check('bleKey:list')")
    @ApiOperation(value = "查询蓝牙钥匙列表")
    @GetMapping("/list/page")
    public ResponseEntity<Object> selectLockList(LockBleKeyInfoListReqVO reqVO, Pageable pageable) {
        return new ResponseEntity<>(lockDeviceBleKeyService.selectBleKeyList(reqVO, pageable), HttpStatus.OK);
    }
}
